<template>
  <el-table :data="list" style="width: 100%;">
    <el-table-column :label="plugin.lang('cash.account_name')" prop="account_name" />
    <el-table-column :label="plugin.lang('cash.bills')" align="center">
      <template #default="scope">
        <el-tag v-if="scope.row.bills_id > 0" type="success" effect="plain">{{ plugin.lang('cash.bills_text.1') }}</el-tag>
        <el-tag v-else effect="plain">{{ plugin.lang('cash.bills_text.0') }}</el-tag>
      </template>
    </el-table-column>
    <el-table-column :label="plugin.lang('cash.money')" align="center">
      <template #default="scope">
        <el-link type="primary" href="javascript:;">{{ money(scope.row.money) }}</el-link>
      </template>
    </el-table-column>
    <el-table-column :label="plugin.lang('cash.content')" min-width="150" prop="content" />
    <el-table-column :label="plugin.lang('cash.time')">
      <template #default="scope">
        {{ time.format(scope.row.created_at) }}
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import app from '@/app'

export default {
  props: [
    'list'
  ],
  setup() {
    return {
      time: app.time,
      money: app.money,
      plugin: app.plugin.index
    }
  }
}
</script>